# -*- coding:utf-8 -*-
# @Time : 21-8-3 下午3:17 
# @Author : zdy
# @File : UserInfo.py
# desc:
import os
import sys

from Class.Format import Serialization


class UserInfo(object):
    def __init__(self):
        self.name = ""
        self.psw = ""
        self.userlevel = 1#1:操作员；2：管理员；4：god


adminuser = UserInfo()
adminuser.name = "admin"
adminuser.psw = "admin"
adminuser.userlevel = 2
goduser = UserInfo()
goduser.name = "god"
goduser.psw = "god123"
goduser.userlevel = 4
usersPath = "Users.bin"
currentuser = UserInfo()
currentUsers = {adminuser.name: adminuser}
def savecurrentUsers():
    # 写入用户名文件
    Serialization.serializeToFile(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), usersPath), currentUsers)
